public class Book {
    private String name;
    private int price;
    private String author;
    private int quantity;

    public Book(String name, int price, String author, int quantity) {
        this.name = name;
        this.price = price;
        this.author = author;
        this.quantity = quantity;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    @Override
    public String toString() {
        return "Book{" +
                "名字:" + name + '\'' +
                ", 价格:" + price +
                ", 作者:" + author + '\'' +
                ", 销量:" + quantity +
                '}';
    }


    @Override
    public boolean equals(Object object) {
        if (object instanceof Book) {
            Book book = (Book) object;
            return this.getQuantity() > book.getQuantity();
        }
        return false;
    }
}
